import os
path = os.getcwd()
files = os.walk(path)

for dirpath, dirnames, filenames in files:
    print(dirpath) # 当前目录路径
    print(dirnames) # 当前路径下所有子目录
    print(filenames) # 当前路径下所有非目录子文件

    for dir in dirnames: # 遍历当前路径下所有子目录
        print(os.path.join(dirpath, dir)) # 拼接路径，获取目录的绝对路径

    for filename in filenames: # 遍历当前路径下所有非目录子文件
        print(os.path.join(dirpath, filename)) # 拼接路径，获取文件的绝对路径